import pandas as pd
import os
def read_all_csv_in_folder(folder_path):
    # 获取文件夹中的所有CSV文件名
    csv_files = [f for f in os.listdir(folder_path) if f.endswith('.csv')]

    # 初始化一个空的DataFrame列表
    df_list = []

    # 遍历所有CSV文件并读取它们
    for file in csv_files:
        file_path = os.path.join(folder_path, file)
        df = pd.read_csv(file_path)
        df_list.append(df)

    # 将所有DataFrame合并为一个
    combined_df = pd.concat(df_list, ignore_index=True)

    return combined_df